# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-rope
pkgver=1.11.0
pkgrel=0
pkgdesc="Python refactoring library"
url="https://github.com/python-rope/rope"
arch="noarch"
license="LGPL-3.0-only"
depends="py3-pytoolconfig py3-setuptools"
makedepends="
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-build
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-rope/rope/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/rope-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# test_search_submodule fails to find env from py3-build
	.testenv/bin/python3 -m pytest -k 'not test_search_submodule'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
8ac78a8e946db22faeb661a60f1f370bbf9c4400347305673c7a4b9b3c4bb3ed38f9db8f324fa174f1341b59557008430b4d13d32eb5138a13c09c851059d6cc  py3-rope-1.11.0.tar.gz
"
